package com.fz.us.oa.core.entity.com;

import com.fz.us.admin.company.entity.BaseFlowEntity;
import com.fz.us.oa.core.entity.common.FileManage;

import javax.persistence.*;
import java.util.Date;
import java.util.List;

/**
 * Created by ZhuChunXiao on 2017/5/24.
 * 离职申请
 */
@Entity
@Table(name="ec_quit")
public class Quit extends BaseFlowEntity {
    private static final long serialVersionUID = -475510347456134590L;
    /**
     * 人事信息表
     */
    private PersonnelInfo personnelInfo;
    /**
     * 离职性质 1辞职 2辞退
     */
    private int type;
    /**
     * 离职原因
     */
    private String reason;
    /**
     * 辞职报告附件
     */
    private List<FileManage> file;
    /**
     * 预计离职日期
     */
    private Date date;
    /**
     * 备注
     */
    private String remarks;
    /**
     * 异动管理
     */
    private AllChange allChange;

    @ManyToOne(fetch = FetchType.LAZY)
    public PersonnelInfo getPersonnelInfo() {
        return personnelInfo;
    }

    public void setPersonnelInfo(PersonnelInfo personnelInfo) {
        this.personnelInfo = personnelInfo;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    @ManyToMany(fetch = FetchType.LAZY)
    @JoinTable(name = "ec_quit_file", joinColumns = @JoinColumn(name="id"),inverseJoinColumns = @JoinColumn(name="fileId"))
    public List<FileManage> getFile() {
        return file;
    }

    public void setFile(List<FileManage> file) {
        this.file = file;
    }

    @OneToOne(fetch = FetchType.LAZY)
    public AllChange getAllChange() {
        return allChange;
    }

    public void setAllChange(AllChange allChange) {
        this.allChange = allChange;
    }
}
